package com.zyq.core.controller;

import com.zyq.common.vo.Result;
import com.zyq.core.utils.OSSUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 翟彦淇
 * @description TODO
 * @date 2022/12/5 22:50
 */
@RestController
@RequestMapping("/core/course")
@Api(value = "课程信息操作控制层")
public class CourseController {


    @RequestMapping("/uploadCover")
    @ApiOperation(value = "向阿里云上传图片(课程封面)")
    @ApiImplicitParams(
            @ApiImplicitParam(value = "图片文件",name="file",dataType = "MultipartFile")
    )
    public Result<String> uploadCover(MultipartFile file){
        System.out.println(file.getContentType());
        String s = OSSUtil.upLoadImg(file);
        System.out.println("s = " + s);
        return null;
    }

}
